import request from "../utils/request";
// 根据id商品分类
export function getById(id){
    return request.get(`/catagorys/${id}`);
}
// 获取分类
export function getList(params){
    return request.get("/catagorys", { params: params });
}
// 获取父级分类
export function getParent(params){
    return request.get("/catagorys", { params: params });
}
// 修改状态
export function vimState(id, delivery) {
  return request.post(`/catagorys/IsActived/${id}`, delivery);
}

// 添加分类
export function addCate(data){
    return request.post("/catagorys", data);
}


// 修改商品分类
export function modCate(id, data) {
         return request.put(`/catagorys/${id}`, data);
       }
//删除分类
export function deleteCate(id, data) {
         return request.delete(`/catagorys/${id}`, data);
       }